//
//  CollectionDetailTableViewCell.m
//  LubanWork
//
//  Created by xiaohao on 2020/1/2.
//  Copyright © 2020 xiaohao. All rights reserved.
//

#import "CollectionDetailTableViewCell.h"

@implementation CollectionDetailTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style
             reuseIdentifier:reuseIdentifier]) {
        [self setFrame];
    }
    return self;
    
}
 
-(void)setFrame{
    [self addSubview:self.titLab];
    [self addSubview:self.detaiLab];
    [self addSubview:self.dayLab];
    [self addSubview:self.timeLab];
    [self addSubview:self.sexLab];
    [self addSubview:self.signLab];
    [self addSubview:self.priceLab];

    [self.titLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(kSCRATIO(25.5));
        make.top.mas_offset(KSCHEIGHT(9.5));
    }];
    [self.detaiLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.titLab);
        make.top.mas_equalTo(self.titLab.mas_bottom).mas_offset(KSCHEIGHT(9));
    }];
    [self.dayLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.detaiLab);
        make.top.mas_equalTo(self.detaiLab.mas_bottom).mas_offset(9.5);
        make.width.mas_offset(kSCRATIO(65));
        make.height.mas_offset(KSCHEIGHT(20));
    }];
    [self.timeLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.dayLab.mas_right).mas_offset(kSCRATIO(10));
        make.top.width.height.mas_equalTo(self.dayLab);
        
    }];
    [self.sexLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.timeLab.mas_right).mas_offset(kSCRATIO(10));
        make.top.width.height.mas_equalTo(self.dayLab);
    }];
    [self.signLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.titLab);
        make.right.mas_equalTo(self.mas_right).mas_offset(-25);
    }];
    //价格
    [self.priceLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.titLab);
        make.right.mas_equalTo(self.signLab.mas_left).mas_offset(0);
    }];
 
    
}
-(UILabel *)priceLab{
    if (!_priceLab) {
        _priceLab = [UILabel CreatLabeltext:@"元/天" Font:[UIFont fontWithName:@"Helvetica-Regular" size:18] Textcolor:kColorFromRGBHex(0x775FFB) textAlignment:NSTextAlignmentLeft];
    }
    return _priceLab;
}
-(UILabel *)signLab{
    if (!_signLab) {
        _signLab = [UILabel CreatLabeltext:@"元/天" Font:kFONT(12) Textcolor:kColorFromRGBHex(0x775FFB) textAlignment:NSTextAlignmentLeft];
    }
    return _signLab;
}
-(UILabel *)titLab{
    if (!_titLab) {
        _titLab = [UILabel CreatLabeltext:@"兼职名称兼职名称" Font:[UIFont fontWithName:@"Helvetica-Bold" size:15] Textcolor:kColorFromRGBHex(0x666666) textAlignment:NSTextAlignmentLeft];
    }
    return _titLab;
}
-(UILabel *)detaiLab{
    if (!_detaiLab) {
        _detaiLab = [UILabel CreatLabeltext:@"不限地点" Font:MarkFont(12) Textcolor:kColorFromRGBHex(0xAAAAAA) textAlignment:NSTextAlignmentLeft];
        
    }
    return _detaiLab;
}
-(UILabel *)dayLab{
    if (!_dayLab) {
        _dayLab = [UILabel CreatLabeltext:@"日结" Font:MarkFont(10) Textcolor:kColorFromRGBHex(0x666666) textAlignment:NSTextAlignmentCenter];
        _dayLab.backgroundColor = kColorFromRGBHex(0xF1EEFF);
        ViewRadius(_dayLab, 5);
    }
    return _dayLab;
}
-(UILabel *)timeLab{
    if (!_timeLab) {
        _timeLab = [UILabel CreatLabeltext:@"长期" Font:MarkFont(10) Textcolor:kColorFromRGBHex(0x666666) textAlignment:NSTextAlignmentCenter];
        _timeLab.backgroundColor = kColorFromRGBHex(0xF1EEFF);
        ViewRadius(_timeLab, 5);
    }
    return _timeLab;
}
-(UILabel *)sexLab{
    if (!_sexLab) {
        _sexLab = [UILabel CreatLabeltext:@"男女不限" Font:MarkFont(10) Textcolor:kColorFromRGBHex(0x666666) textAlignment:NSTextAlignmentCenter];
        _sexLab.backgroundColor = kColorFromRGBHex(0xF1EEFF);
        ViewRadius(_sexLab, 5);
    }
    return _sexLab;
}
@end
